//
//  GroupMessageEditViewController.m
//  MyYiJianKangApp
//
//  Created by 张国文 on 16/4/10.
//  Copyright © 2016年 hangzhouyijiyin. All rights reserved.
//

#import "GroupMessageEditViewController.h"

@interface GroupMessageEditViewController ()<UITextFieldDelegate, UITextViewDelegate>

@property (nonatomic, strong) UITextField *groupNameTF; // 小组名字
@property (nonatomic, strong) UITextView *groupIntroduceView; // 小组介绍
@property (nonatomic, strong) UILabel *groupRemarkLabel; // 小组标签
@property (nonatomic, strong) UIImageView *groupImage; // 小组头像

@end

@implementation GroupMessageEditViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    // Do any additional setup after loading the view.
    // navi的修改
    [self changeNavigation];
    // 布局
    [self addMySubview];
}

// navi的修改
- (void)changeNavigation
{
    [self.navigationController.navigationBar setTranslucent:NO];
    self.navigationItem.title = @"小组信息设置";
    UIImageView *leftImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 30, 30)];
    leftImageView.image = [UIImage imageNamed:@"houtui"];
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:leftImageView];
    UITapGestureRecognizer *leftTapGes = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(lastPage:)];
    [leftImageView addGestureRecognizer:leftTapGes];
    
    UIBarButtonItem *rightBarItem = [[UIBarButtonItem alloc] initWithTitle:@"完成" style:UIBarButtonItemStyleDone target:self action:@selector(finish:)];
    rightBarItem.tintColor = [UIColor whiteColor];
    self.navigationItem.rightBarButtonItem = rightBarItem;
    
}

#pragma mark - 返回上一页面
- (void)lastPage:(UITapGestureRecognizer *)tapGes
{
    [self.navigationController popViewControllerAnimated:YES];
}

#pragma mark - 完成
- (void)finish:(UIBarButtonItem *)barItem
{
    // 取消第一响应者
//    [self.groupNameTF resignFirstResponder];
//    [self.groupIntroduceView resignFirstResponder];
    
//    if (self.groupIntroduceView.text.length == 0) {
//        self.groupIntroduceView.text = @"请输入小组介绍 (不超过30字,不能使用空格和换行符)";
//    }
    
//    BOOL isCanSave = YES; // 判断是否可以保存，默认为可以
    NSString *groupName = @"";
    NSString *groupIntroduce = @"";
//    NSLog(@"小组信息设置完成");
//    if ([self.groupNameTF.text containsString:@" "] || [self.groupNameTF.text isEqualToString:@"请输入小组名字 (不超过10个字)"] || self.groupNameTF.text.length > 10) {
//        groupName = @"";
//        isCanSave = NO;
//    } else {
//        groupName = self.groupNameTF.text;
//        isCanSave = YES;
//    }
// 
//    if (self.groupIntroduceView.text.length > 30 || [self.groupIntroduceView.text containsString:@"\n"] ||[self.groupIntroduceView.text containsString:@" "]) {
//        groupIntroduce = @"";
//    } else {
//        groupIntroduce = self.groupIntroduceView.text;
//    }
//    
//    // 提醒框
//    if (groupName.length == 0 && groupIntroduce.length == 0) {
//        if ([self.groupIntroduceView.text isEqualToString:@"请输入小组介绍 (不超过30字,不能使用空格和换行符)"]) {
//            [self addAlertNoSuit:@"小组名字不能包含空格并且不能超过10个字"];
//        } else {
//            // 说明小组名字和小组介绍都不合格
//            [self addAlertNoSuit:@"小组名字不能包含空格并且不能超过10个字；小组介绍不能包含空格、换行符并且不能超过30个字"];
//        }
//        
//    } else if (groupIntroduce.length == 0 && groupName.length != 0) {
//        // 说明小组介绍不合格
//        if ([self.groupIntroduceView.text isEqualToString:@"请输入小组介绍 (不超过30字,不能使用空格和换行符)"]) {
//            
//        } else {
//             [self addAlertNoSuit:@"小组介绍不能包含空格、换行符并且不能超过30个字"];
//        }
//       
//    } else if (groupName.length == 0 && groupIntroduce.length != 0) {
//        // 说明小组名字不合格
//        [self addAlertNoSuit:@"小组名字不能包含空格并且不能超过10个字"];
//    }
//    
//    // 小组名称是必须有的,不能为空，其他的随意
//    if (isCanSave == YES) {
//        if ([self.groupIntroduceView.text isEqualToString:@"请输入小组介绍 (不超过30字,不能使用空格和换行符)"]) {
//            self.groupIntroduceView.text = @"";
//        }
//        
//        
//        NSLog(@"小组名字长度:%ld, 小组介绍长度:%ld", groupName.length, groupIntroduce.length);
//        
//        NSLog(@"小组介绍:%@\n, 小组标签:%@\n, 小组标签:%@\n", groupName, groupIntroduce, self.groupRemarkLabel.text);
//        
//      
//    }
    
    if ([self.groupNameTF.text isEqualToString:@"请输入小组名字 (不超过10个字)"]) {
        groupName = @"";
    } else {
        groupName = self.groupNameTF.text;
    }
    
    // 用户直接点击发送而没有关闭contentTV的第一响应者
    if (![self addZhengZe:self.groupIntroduceView.text]) {
                self.groupIntroduceView.text = @"请输入小组介绍 (不超过30字,不能使用空格和换行符)";
            }
    
    BOOL groupIntroduceHaveMessage = YES; // 小组介绍有没有
    if ([self.groupIntroduceView.text isEqualToString:@"请输入小组介绍 (不超过30字,不能使用空格和换行符)"]) {
        // 说明没有
        groupIntroduce = @"";
        groupIntroduceHaveMessage = NO;
    } else {
        // 说明自己添加了
        groupIntroduce = self.groupIntroduceView.text;
        groupIntroduceHaveMessage = YES;
    }
    
//    if ((groupName.length < 1 || groupName.length > 10) && groupIntroduceHaveMessage == NO) {
//        [self addAlertNoSuit:@"小组名字请输入1-10个字符"];
//    } else if ((groupName.length < 1 || groupName.length > 10) && groupIntroduceHaveMessage == YES) {
//        if (groupIntroduce.length < 1 && groupIntroduce.length > 30) {
//            [self addAlertNoSuit:@"小组名字请输入1-10个字符，小组介绍请输入1-30个字符"];
//        }
//    } else if (groupIntroduceHaveMessage == YES) {
//        [self addAlertNoSuit:@"小组介绍请输入1-30个字符"];
//    }
//    
    
    
    if (groupIntroduceHaveMessage == YES) {
        if (groupIntroduce.length < 1 || groupIntroduce.length > 30 || groupName.length < 1 || groupName.length > 10) {
            [self addAlertNoSuit:@"小组名字请输入1-10个字，小组介绍请输入1-30个字"];
        } else {
            if (![self addZhengZe:groupName] || ![self addZhengZe:groupIntroduce]) {
                [self addAlertNoSuit:@"小组名字和小组介绍应该输入汉字|字母|数字|下划线"];
            } else {
                NSLog(@"小组介绍不为空时：小组名字：%@, 小组介绍：%@", groupName, groupIntroduce);
            }
        }
    } else {
        if (groupName.length < 1 || groupName.length > 10) {
            [self addAlertNoSuit:@"小组名字请输入1-10个字"];
        } else {
            if (![self addZhengZe:groupName]) {
                [self addAlertNoSuit:@"小组名字应该输入汉字|字母|数字|下划线"];
            } else {
                NSLog(@"小组介绍为空时：小组名字：%@, 小组介绍：%@", groupName, groupIntroduce);
            }
        }
    }
    
    
    
    
}

- (void)addAlertNoSuit:(NSString *)content
{
    UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:@"提醒" message:content preferredStyle:UIAlertControllerStyleAlert];
    // 修改标题颜色
    NSMutableAttributedString *title = [[NSMutableAttributedString alloc] initWithString:@"提醒"];
    [title addAttribute:NSForegroundColorAttributeName value:[UIColor redColor] range:NSMakeRange(0, 2)];
    [title addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:17] range:NSMakeRange(0, 2)];
    [alertVC setValue:title forKey:@"attributedTitle"];
    
    UIAlertAction *sureAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
        NSLog(@"确定");
    }];
    [alertVC addAction:sureAction];
    [self presentViewController:alertVC animated:YES completion:^{
        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
            [self dismissViewControllerAnimated:YES completion:nil];
        });
    }];

}

#pragma mark - 布局
- (void)addMySubview
{
    UIView *grayBackGroundView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight)];
    grayBackGroundView.userInteractionEnabled = YES;
    grayBackGroundView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.03];
    [self.view addSubview:grayBackGroundView];
    
    // 小组名字前
    UILabel *xiaozumingziLabel = [[UILabel alloc] initWithFrame:CGRectMake(15 * kAdjustParamater, 20 * kAdjustParamater, 80 * kAdjustParamater, 17 * kAdjustParamater)];
  //  xiaozumingziLabel.backgroundColor = [[UIColor redColor] colorWithAlphaComponent:0.1];
    xiaozumingziLabel.text = @"小组名字";
    xiaozumingziLabel.textColor = [UIColor blackColor];
    xiaozumingziLabel.textAlignment = NSTextAlignmentLeft;
    xiaozumingziLabel.font = [UIFont systemFontOfSize:k16Big];
    [grayBackGroundView addSubview:xiaozumingziLabel];
    
    // 小组名字
    self.groupNameTF = [[UITextField alloc] initWithFrame:CGRectMake(100 * kAdjustParamater, xiaozumingziLabel.top, 350, 17 * kAdjustParamater)];
    self.groupNameTF.textColor = [[UIColor blackColor] colorWithAlphaComponent:0.5];
    if (self.groupNameTF.text.length == 0) {
        // 说明没有名字
        self.groupNameTF.text = @"请输入小组名字 (不超过10个字)";
    }
    self.groupNameTF.clearButtonMode = UITextFieldViewModeWhileEditing;
    self.groupNameTF.tintColor = kCyanColor;
    self.groupNameTF.textAlignment = NSTextAlignmentLeft;
    self.groupNameTF.delegate = self;
    [self.groupNameTF addTarget:self action:@selector(textChange:) forControlEvents:UIControlEventAllEditingEvents];
    self.groupNameTF.font = [UIFont systemFontOfSize:k16Big];
    [grayBackGroundView addSubview:_groupNameTF];
    
    // 灰色条
    UILabel *grayLine1 = [[UILabel alloc] initWithFrame:CGRectMake(0, xiaozumingziLabel.bottom + 8 * kAdjustParamater, kScreenWidth, 2 * kAdjustParamater)];
    grayLine1.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    [grayBackGroundView addSubview:grayLine1];
    
    // 小组介绍前
    UILabel *xiaozujieshaoLabel = [[UILabel alloc] initWithFrame:CGRectMake(15 * kAdjustParamater, grayLine1.bottom + 12 * kAdjustParamater, 80 * kAdjustParamater, 17 * kAdjustParamater)];
 //   xiaozujieshaoLabel.backgroundColor = [[UIColor redColor] colorWithAlphaComponent:0.1];
    xiaozujieshaoLabel.text = @"小组介绍";
    xiaozujieshaoLabel.textColor = [UIColor blackColor];
    xiaozujieshaoLabel.textAlignment = NSTextAlignmentLeft;
    xiaozujieshaoLabel.font = [UIFont systemFontOfSize:k16Big];
    [grayBackGroundView addSubview:xiaozujieshaoLabel];
    
    // 小组介绍白色背景
    UIView *xiaozujieshaoWhiteView = [[UIView alloc] initWithFrame:CGRectMake(15 * kAdjustParamater, xiaozujieshaoLabel.bottom + 8 * kAdjustParamater, 345 * kAdjustParamater, 80 * kAdjustParamater)];
    xiaozujieshaoWhiteView.backgroundColor = [UIColor whiteColor];
    xiaozujieshaoWhiteView.userInteractionEnabled = YES;
    xiaozujieshaoWhiteView.layer.cornerRadius = 5 * kAdjustParamater;
    [grayBackGroundView addSubview:xiaozujieshaoWhiteView];
    
    // 小组介绍
    self.groupIntroduceView = [[UITextView alloc] initWithFrame:CGRectMake(10 * kAdjustParamater, 8 * kAdjustParamater, 325 * kAdjustParamater, 64 * kAdjustParamater)];
 //   self.groupIntroduceView.backgroundColor = [[UIColor redColor] colorWithAlphaComponent:0.1];
    self.groupIntroduceView.textColor = [[UIColor blackColor] colorWithAlphaComponent:0.5];
    self.groupIntroduceView.textAlignment = NSTextAlignmentLeft;
    self.groupIntroduceView.font = [UIFont systemFontOfSize:k16Big];
    self.groupIntroduceView.tintColor = kCyanColor;
    if (self.groupIntroduceView.text.length == 0) {
        // 说明为空
        self.groupIntroduceView.text = @"请输入小组介绍 (不超过30字,不能使用空格和换行符)";
    }
    self.groupIntroduceView.delegate = self;
    [xiaozujieshaoWhiteView addSubview:_groupIntroduceView];
    // 添加tv辅助视图
    // 构建辅助视图
    UIView *seorryView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 25 * kAdjustParamater)];
    seorryView.backgroundColor = [UIColor colorWithRed:249 / 255.0 green:249 / 255.0 blue:249 / 255.0 alpha:1];
    
    UILabel *grayLineOnSeorryView = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 1 * kAdjustParamater)];
    grayLineOnSeorryView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    [seorryView addSubview:grayLineOnSeorryView];
    
    // 完成button
    UIButton *textViewFinishButton = [UIButton buttonWithType:UIButtonTypeSystem];
    textViewFinishButton.frame = CGRectMake(334  *kAdjustParamater, 5 * kAdjustParamater, 30 * kAdjustParamater, 15 * kAdjustParamater);
    textViewFinishButton.layer.cornerRadius = 2 * kAdjustParamater;
    [textViewFinishButton setTitle:@"完成" forState:UIControlStateNormal];
    [textViewFinishButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    textViewFinishButton.backgroundColor = kCyanColor;
    textViewFinishButton.titleLabel.font = [UIFont systemFontOfSize:k13Big];
    [textViewFinishButton addTarget:self action:@selector(tvFinish:) forControlEvents:UIControlEventTouchUpInside];
    [seorryView addSubview:textViewFinishButton];
    self.groupIntroduceView.inputAccessoryView = seorryView;
    
    // 小组标签
    UILabel *xiaozubiaoqianLabel = [[UILabel alloc] initWithFrame:CGRectMake(15 * kAdjustParamater, xiaozujieshaoWhiteView.bottom + 12 * kAdjustParamater, 80 * kAdjustParamater, 17 * kAdjustParamater)];
 //   xiaozubiaoqianLabel.backgroundColor = [[UIColor redColor] colorWithAlphaComponent:0.1];
    xiaozubiaoqianLabel.text = @"小组标签";
    xiaozubiaoqianLabel.textAlignment = NSTextAlignmentLeft;
    xiaozubiaoqianLabel.textColor = [UIColor blackColor];
    xiaozubiaoqianLabel.font = [UIFont systemFontOfSize:k16Big];
    [grayBackGroundView addSubview:xiaozubiaoqianLabel];
    
    // 小组标签背景
    UIView *xiaozubiaoqianWhiteView = [[UIView alloc] initWithFrame:CGRectMake(15 * kAdjustParamater, xiaozubiaoqianLabel.bottom + 8 * kAdjustParamater, 345 * kAdjustParamater, 80 * kAdjustParamater)];
    xiaozubiaoqianWhiteView.backgroundColor = [UIColor whiteColor];
    xiaozubiaoqianWhiteView.layer.cornerRadius = 5 * kAdjustParamater;
    xiaozubiaoqianWhiteView.userInteractionEnabled = YES;
    [grayBackGroundView addSubview:xiaozubiaoqianWhiteView];
    
    // 小组标签
    self.groupRemarkLabel = [[UILabel alloc] initWithFrame:CGRectMake(10 * kAdjustParamater, 8 * kAdjustParamater, 325 * kAdjustParamater, 64 * kAdjustParamater)];
   // self.groupRemarkLabel.backgroundColor = [[UIColor redColor] colorWithAlphaComponent:0.1];
    self.groupRemarkLabel.text = @"#健康达人#我爱看电影#我爱听音乐#";
    self.groupRemarkLabel.numberOfLines = 0;
    self.groupRemarkLabel.textAlignment = NSTextAlignmentLeft;
    self.groupRemarkLabel.textColor = [[UIColor blackColor] colorWithAlphaComponent:0.5];
    self.groupRemarkLabel.font = [UIFont systemFontOfSize:k16Big];
    [xiaozubiaoqianWhiteView addSubview:_groupRemarkLabel];
    // 自适应高度
    CGRect newFrame = self.groupRemarkLabel.frame;
    newFrame.size.height = [[NetStatusHandle shareHandle] adjustHeight:self.groupRemarkLabel.text size:16 width:325];
    self.groupRemarkLabel.frame = newFrame;
    
    
    // 小组头像前
    UILabel *xiaozutouxiangLabel = [[UILabel alloc] initWithFrame:CGRectMake(15 * kAdjustParamater, xiaozubiaoqianWhiteView.bottom + 45 * kAdjustParamater, 80 * kAdjustParamater, 17 * kAdjustParamater)];
   // xiaozutouxiangLabel.backgroundColor = [[UIColor redColor] colorWithAlphaComponent:0.1];
    xiaozutouxiangLabel.text = @"小组头像";
    xiaozutouxiangLabel.textColor = [UIColor blackColor];
    xiaozutouxiangLabel.textAlignment = NSTextAlignmentLeft;
    xiaozutouxiangLabel.font = [UIFont systemFontOfSize:k16Big];
    [grayBackGroundView addSubview:xiaozutouxiangLabel];
    
    // 小组头像
    self.groupImage = [[UIImageView alloc] initWithFrame:CGRectMake(100 * kAdjustParamater,xiaozubiaoqianWhiteView.bottom + 20 * kAdjustParamater, 70 * kAdjustParamater, 70 * kAdjustParamater)];
    self.groupImage.image = [UIImage imageNamed:@""];
    if (self.groupImage.image == nil) {
        self.groupImage.image = [UIImage imageNamed:@"huisetianjiakuang-fenzuguanli"];
    }
    self.groupImage.userInteractionEnabled = YES;
    [grayBackGroundView addSubview:_groupImage];
    
    // 为头像添加手势
    UITapGestureRecognizer *groupImageTapGes = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(selectImage:)];
    [self.groupImage addGestureRecognizer:groupImageTapGes];
    
    // 小组头像右边的提示消息
    UILabel *alertMessge = [[UILabel alloc] initWithFrame:CGRectMake(self.groupImage.right + 20 * kAdjustParamater, self.groupImage.top + 27 * kAdjustParamater, 100 * kAdjustParamater, 15 * kAdjustParamater)];
    alertMessge.text = @"点击选择图片";
    alertMessge.textColor = [[UIColor blackColor] colorWithAlphaComponent:0.5];
    alertMessge.textAlignment = NSTextAlignmentLeft;
    alertMessge.font = [UIFont systemFontOfSize:k14Big];
    [grayBackGroundView addSubview:alertMessge];
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
}

#pragma mark - 正则表达式
- (BOOL)addZhengZe:(NSString *)string
{
    NSString *regex = @"^[a-zA-Z0-9\u4e00-\u9fa5,:_]+$";
    NSPredicate *pred = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regex];
    BOOL isMatch = [pred evaluateWithObject:string];
    return isMatch;
}

- (void)addAlertNotSuit:(NSString *)content
{
    UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:@"提醒" message:content preferredStyle:UIAlertControllerStyleAlert];
    // 修改标题颜色
    NSMutableAttributedString *title = [[NSMutableAttributedString alloc] initWithString:@"提醒"];
    [title addAttribute:NSForegroundColorAttributeName value:[UIColor redColor] range:NSMakeRange(0, 2)];
    [title addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:17] range:NSMakeRange(0, 2)];
    [alertVC setValue:title forKey:@"attributedTitle"];
    
    UIAlertAction *sureAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
        NSLog(@"确定");
    }];
    [alertVC addAction:sureAction];
    [self presentViewController:alertVC animated:YES completion:^{
        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
            [self dismissViewControllerAnimated:YES completion:nil];
        });
    }];
}


#pragma mark - 小组名字改变
- (void)textFieldDidBeginEditing:(UITextField *)textField
{
//    if (self.groupIntroduceView.text.length == 0 || [self.groupIntroduceView.text containsString:@"\n"] || [self.groupIntroduceView.text containsString:@" "]) {
//        self.groupIntroduceView.text = @"请输入小组介绍 (不超过30字,不能使用空格和换行符)";
//    }
    if (![self addZhengZe:self.groupIntroduceView.text]) {
        self.groupIntroduceView.text = @"请输入小组介绍 (不超过30字,不能使用空格和换行符)";
    }
    if (![self addZhengZe:textField.text] || [textField.text isEqualToString:@"请输入小组名字 (不超过10个字)"]) {
        textField.text = @"";
    }
}

- (void)textChange:(UITextField *)textField
{
    NSLog(@"小组标题 = %@", textField.text);
    
}

- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
    if (![self addZhengZe:textField.text] || textField.text.length == 0 ) {
        textField.text = @"请输入小组名字 (不超过10个字)";
    }
    [textField resignFirstResponder];
    return YES;
}





#pragma mark - 选择头像
- (void)selectImage:(UITapGestureRecognizer *)tapGes
{
    NSLog(@"选择头像");
}

#pragma mark - 回收键盘
- (void)tvFinish:(UIButton *)button
{
    NSLog(@"回收键盘");
    
//    if (self.groupIntroduceView.text.length == 0 ||[self.groupIntroduceView.text containsString:@"\n"] || [self.groupIntroduceView.text containsString:@" "] ) {
//        self.groupIntroduceView.text = @"请输入小组介绍 (不超过30字,不能使用空格和换行符)";
//    }
    if (![self addZhengZe:self.groupIntroduceView.text]) {
        self.groupIntroduceView.text = @"请输入小组介绍 (不超过30字,不能使用空格和换行符)";
    }
    
    [self.groupIntroduceView resignFirstResponder];
}



- (void)textViewDidBeginEditing:(UITextView *)textView
{
//    if (self.groupNameTF.text.length == 0 || [self.groupNameTF.text containsString:@" "]) {
//        self.groupNameTF.text = @"请输入小组名字 (不超过10个字)";
//    }
    if (![self addZhengZe:self.groupNameTF.text] || self.groupNameTF.text.length == 0) {
         self.groupNameTF.text = @"请输入小组名字 (不超过10个字)";
    }
    NSLog(@"小组介绍 = %@", textView.text);
    if (![self addZhengZe:textView.text] || [textView.text isEqualToString:@"请输入小组介绍 (不超过30字,不能使用空格和换行符)"]) {
        textView.text = @"";
    }
}

- (void)textViewDidChange:(UITextView *)textView
{
    NSLog(@"小组介绍 = %@", textView.text);
    
}




- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
